<%
'先定义
'IT_ID			--资讯类型ID
'Info_Special	--资讯专题
'Info_Title		--资讯标题
'Info_Sub_Title --资讯副标题
'Info_Pic		--资讯相关图片 主要用于存放景区指南图片 /存放于/UploadImages/Info/目录下
'Info_ZY		--资讯摘要
'Info_Content	--资讯内容
'Info_Keywords	--关连关键字 以|分隔
'Info_IsTop		--是置顶
'Update_Name	--更新人
'Update_Date	--更新日期

Dim IT_ID
Dim BT_ID
Dim Info_Special
Dim Info_Type		
Dim Info_Title
Dim Info_Sub_Title
Dim Info_URL
Dim Info_Pic
Dim Info_ZY
Dim Info_Content	
Dim Info_Keywords	
Dim Info_IsTop
Dim Info_JC
Dim Info_Audit '审核标志

Dim Update_Name
Dim Update_Date

Sub Get_Info_Data()

	BT_ID = reform("BT_ID")
	Call Check_IsNumeric_Msg(BT_ID,"资讯大类ID")

	IT_ID = reform("IT_ID")
	Call Check_IsNumeric_Msg(IT_ID,"资讯小类ID")


	Info_Title		= reform("Info_Title")
	Info_Sub_Title	= reform("Info_Sub_Title")
	Info_URL		= reform("Info_URL")
	Info_Pic		= reform("Info_Pic")
	Info_ZY			= reform("Info_ZY")
	Info_Content    = reform("Info_Content")
	Info_Audit		= reform("Info_Audit")

	Update_Name		= Session("Admin_UserName")
	Update_Date		= now()
	
End Sub 

Sub Info_Add()	
	

	Call Get_Info_Data()

	sql = "INSERT INTO News( " &_
		"Info_Type_ID"&_

		",Info_Title"&_
		",Info_Sub_Title"&_
		",Info_URL"&_

		",Info_Pic"&_

		",Info_ZY"&_
		",Info_Content"&_

		",Update_Name"&_
		",Update_Date"&_
		",Info_Audit"&_

		") VALUES( " &_
		""&IT_ID&_

		",'"&Info_Title&"'"&_
		",'"&Info_Sub_Title&"'"&_
		",'"&Info_URL&"'"&_
		",'"&Info_Pic&"'"&_
		
		",'"&Info_ZY&"'"&_
		",'"&Info_Content&"'"&_


		",'"&Update_Name&"'"&_
		",'"&Update_Date&"'"&_
		","&Info_Audit&_
		")"
    conn.execute(sql)


	Session("IT_ID") = IT_ID

	AlertBox "资讯增加成功！","Info_Query.asp"


End Sub

Sub Info_Edit()	


	Call Get_Info_Data()
	Info_ID = Reform("Info_ID")
	Call Check_IsNumeric(Info_ID)

	sql = "UPDATE News Set " &_
		  "Info_Type_ID = "& IT_ID &_

		  ",Info_Title ='"&Info_Title&"'"&_
		  ",Info_Sub_Title ='"&Info_Sub_Title&"'"&_
		  ",Info_URL ='"&Info_URL&"'"&_
		  ",Info_Pic ='"&Info_Pic&"'"&_
		  ",Info_ZY ='"&Info_ZY&"'"&_
		  ",Info_Content ='"&Info_Content&"'"&_

		  ",Update_Name ='"&Update_Name&"'"&_
		  ",Update_Date ='"&Update_Date&"'"&_
		  ",Info_Audit = "& Info_Audit &_

		  " WHERE Info_ID = "&Info_ID

    conn.execute(sql)

	AlertBox "资讯修改成功！","Info_Query.asp"

End Sub

Sub Info_Del()

	Dim Info_ID

	Info_ID = Reform("OP_ID")
	

	sql = "DELETE FROM  News WHERE Info_ID IN ( "&Info_ID &")"


    conn.execute(sql)

	AlertBox "资讯删除成功！","Info_Query.asp"
	
End Sub

Sub Get_Info(Info_ID)

	Call Check_IsNumeric(Info_ID)


	sql = "SELECT Info_Type_ID,Info_Title,Info_Sub_Title,Info_Pic,Info_ZY,Info_Content,Info_Keywords,Info_IsTop,Info_JC,BT_ID,Info_URL,Info_Audit FROM uvw_News WHERE Info_ID = " &Info_ID
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		IT_ID			= rs("Info_Type_ID")

		Info_Title		= rs("Info_Title")
		Info_Sub_Title	= rs("Info_Sub_Title")
		Info_Pic		= rs("Info_Pic")
		Info_ZY			= rs("Info_ZY")
		Info_Content	= rs("Info_Content")
		Info_URL		= rs("Info_URL")
		BT_ID			= rs("BT_ID")
		Info_Audit		= rs("Info_Audit")

	End If


End Sub 
%>


